package cn.ctodb.im.dto;

import cn.ctodb.im.proto.Message;

/**
 * All rights Reserved, Designed By www.ctodb.cn
 *
 * @version V1.0
 * @author: lichaohn@163.com
 * @date: 2018-11-12 16:55
 * @Copyright: 2018 www.ctodb.cn All rights reserved.
 */
public class MessageRespDTO extends AbstractDTO<Message.MessageResp> {

    private long id;
    private long cc;
    private long ts;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getCc() {
        return cc;
    }

    public void setCc(long cc) {
        this.cc = cc;
    }

    public long getTs() {
        return ts;
    }

    public void setTs(long ts) {
        this.ts = ts;
    }

    @Override
    public void fromProto(Message.MessageResp messageResp) {
        setCc(messageResp.getCc());
        setId(messageResp.getId());
        setTs(messageResp.getTs());
    }

    @Override
    public Message.MessageResp toProto() {
        return Message.MessageResp.newBuilder().setCc(getCc()).setId(getId()).setTs(getTs()).build();
    }
}
